{% extends 'bootstrap/base.html' %}


{% block title %}
    IQC 标签打印
{% endblock %}



{% block scripts %}
    {{ super() }}
    <script>
        {#检测按了回车键#}
        $("#Bill_info").keypress(function (e) {
            if(e.which == 13){
                var bill_no = $('#Bill_info').val();
                $('#BillNo').val(bill_no)
                console.log(bill_no)
                $.ajax({
                    type: "GET",
                    url: "/bill_info",
                    data: 'bill_no=' + bill_no,
                    dataType: "json",
                    success: function (msg) {
                        var obj = document.getElementById("MB001");
                        obj.options.length = 0
                        for (var i of msg) {
                            console.log(i.MB001)
                            MB001 = i.MB001
                            obj.add(new Option(MB001, MB001));
                        }
                        ;


                    },
                    error: function () {
                        alert("错误");
                    }
                });
            }




        });

    </script>

{% endblock %}

{% block content %}
    <h1>IQC 标签打印</h1>
    <div class="col-lg-6">


        <div class="col-lg-12">
            <label>单号</label>
            <input type="text" id="Bill_info">

            <form action="/print" method="post" target="_blank">
                {{ form.BillNo(style="display:none")}}
                {{ form.MB001.label }}
                {{ form.MB001 }}
                {{ form.print_count.label }}
                {{ form.print_count }}
                {{ form.single_num.label }}
                {{ form.single_num }}
                {{ form.total_num.label }}
                {{ form.total_num }}
                {{ form.submit(class="btn-primary") }}
            </form>
        </div>

{% endblock %}